param([string] $exportPath)
[System.Reflection.Assembly]::Load('Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c') | Out-Null
[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") | Out-Null 


$dir = $exportPath.TrimEnd('\') + '\'

$solutions = [Microsoft.SharePoint.Administration.SPFarm]::Local.Solutions
$solutions | foreach-object { $path = $dir + $_.SolutionFile.Name ; write-host $path; $_.SolutionFile.SaveAs($path) }